﻿using System;
using System.Collections.Generic;
using System.Text;
using UMLDesigner.Widgets;
using UMLDesigner.WorkUnits;

namespace UMLDesigner
{
    public class ClassDiagramDocument : Document
    {
        public ClassDiagramDocument()
        {
            classNumber = 1;
        }

        public override void AddWidget(UMLWidgetType type)
        {
            UMLWidget widget = null;

            switch(type)
            {
                case UMLWidgetType.CLASS:
                    widget = new ClassWidget();
                    widget.Name = "Class" + classNumber;
                    classNumber++;
                    break;
                case UMLWidgetType.NOTE:
                    widget = new NoteWidget();
                    break;
            }

            AddWidget(widget);

            NewWidgetWorkUnit unit = new NewWidgetWorkUnit(widget);
            history.Add(unit);
        }

        private int classNumber;
    }
}
